﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using You.Niao.ShaFa.Model;
using DBUtility;
using Common.Base;
using You.Niao.ShaFa.IDAL;

namespace You.Niao.ShaFa.DAL
{
    public class ReleaseDAL:SqlConn,IRelease
    {
        public int Release(Release Rmodel)
        {
            string sql = "insert into Release(UserID,Province,City,Area,ReceptionNumber,ReceptionDays,Sex,IsEntourage,Deadline,Title,Description) values(@UserID,@Province,@City,@Area,@ReceptionNumber,@ReceptionDays,@Sex,@IsEntourage,@Deadline,@Title,@Description)";
            SqlParameter[] pars ={
                                     new SqlParameter("@UserID",Rmodel.UserID),
                                     new SqlParameter("@Province",Rmodel.Province),
                                     new SqlParameter("@City",Rmodel.City),
                                     new SqlParameter("@Area",Rmodel.Area),
                                     new SqlParameter("@ReceptionNumber",Rmodel.ReceptionNumber),
                                     new SqlParameter("@ReceptionDays",Rmodel.ReceptionDays),
                                     new SqlParameter("@Sex",Rmodel.Sex),
                                     new SqlParameter("@IsEntourage",Rmodel.IsEntourage),
                                     new SqlParameter("@Deadline",Rmodel.Deadline),
                                     new SqlParameter("@Title",Rmodel.Title),
                                     new SqlParameter("@Description",Rmodel.Description)
                                 };
            return DbHelperSQL.ExecuteSql(ShaFaConn,sql,pars);
        }
    }
}
